package com.bk.controller.user;
import com.bk.dto.InnovationDTO;
import com.bk.dto.InnovationPageQueryDTO;
import com.bk.entity.Innovation;
import com.bk.result.PageResult;
import com.bk.result.Result;
import com.bk.service.InnovationService;
import com.bk.vo.InnovationDetailsVO;
import com.bk.vo.InnovationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 帖子
 */
@RestController
@RequestMapping("/user/innovation")
@Slf4j
@Api(tags = "帖子相关接口")
public class InnovationController {
    @Autowired
    private InnovationService innovationService;


    /**
     * 发帖子
     * @param innovationDTO
     * @return
     */
    @PostMapping
    @ApiOperation("发帖子")
    public Result save(@RequestBody InnovationDTO innovationDTO)
    {

        return Result.success();
    }
    /**
     * 帖子分页查询
     * @param innovationPageQueryDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("帖子分页查询")
    public Result<PageResult> page(InnovationPageQueryDTO innovationPageQueryDTO)
    {
        return Result.success();
    }

    /**
     * 根据id查询 帖子详情
     * @param detailId
     * @return
     */
    @GetMapping("/{detailId}")
    @ApiOperation("根据id查询帖子详情")
    public Result<InnovationDetailsVO> getByDetailId(@PathVariable Long detailId)
    {
        return Result.success();
    }

    /**
     * 根据id查询 帖子基本信息(回显)
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    @ApiOperation("根据id查询帖子信息")
    public Result<Innovation> getById(@PathVariable Long id)
    {
        return Result.success();
    }

    /**
     * 编辑帖子
     * @param innovationDTO
     * @return
     */
    @PutMapping
    @ApiOperation("编辑帖子")
    public Result update(@RequestBody InnovationDTO innovationDTO)
    {
        return Result.success();
    }

    /**
     * 点赞帖子
     * @param innovationId  帖子id
     * @return
     */
    @PutMapping("/like")
    @ApiOperation("点赞帖子")
    public Result<Integer> like(Long innovationId)
    {
        return Result.success();
    }

    /**
     * 收藏帖子
     * @param innovationId  帖子id
     * @return
     */
    @PutMapping("/preserve")
    @ApiOperation("收藏帖子")
    public Result<Integer> preserve(Long innovationId)
    {
        return Result.success();
    }
    /**
     * 评论帖子
     * @param innovationId  帖子id
     * @return
     */
    @PutMapping("/comment")
    @ApiOperation("评论帖子")
    public Result comment(Long innovationId,String content)
    {
        return Result.success();
    }

}
